//
//  GlobalTargetConfig.swift
//  MT
//
//  Created by zhang qiang on 2018/11/26.
//  Copyright © 2019年 张强. All rights reserved.
//

import Foundation
import RxSwift


 /// target 配置
 ///
 /// - debug: 开发调试
 /// - test: 内部测试
 /// - pre: 预发布
 /// - release: 正式发布
public enum TargetConfig: Int {
    case debug = 1
    case test = 2
    case staging = 3
    case release = 4
}

/// 当前target环境
public var targetConfig: TargetConfig {
    get {
        return TargetConfig(rawValue: UserDefaults.Enviroment.env.storedInt)!
    }
}

public let downloadQRCodeInPost = "https://mobile.daydaycook.com.cn/diary/download/index.html"

#if DEBUG
//let AuthReleaseServer = "http://mitu-app.bantiaoyu.cn"
//let AuthTestServer = "http://mitu-app.bantiaoyu.cn"
//let AuthStagingServer = "http://mitu-app.bantiaoyu.cn"
//let AuthDevServer = "http://mitu-app.bantiaoyu.cn"
let AuthReleaseServer = "http://mygs-api.bantiaoyu.cn"
let AuthTestServer = "http://mygs-api.bantiaoyu.cn"
let AuthStagingServer = "http://mygs-api.bantiaoyu.cn"
let AuthDevServer = "http://mygs-api.bantiaoyu.cn"
#else
let AuthReleaseServer = "http://mygs-api.bantiaoyu.cn"
let AuthTestServer = "http://mygs-api.bantiaoyu.cn"
let AuthStagingServer = "http://mygs-api.bantiaoyu.cn"
let AuthDevServer = "http://mygs-api.bantiaoyu.cn"
//let AuthReleaseServer = "http://mitu-app.bantiaoyu.cn"
//let AuthTestServer = "http://mitu-app.bantiaoyu.cn"
//let AuthStagingServer = "http://mitu-app.bantiaoyu.cn"
//let AuthDevServer = "http://mitu-app.bantiaoyu.cn"
#endif

#if DEBUG
//let shareUrl = "https://app-secwmd.openinstall.io/js-test?inviterId="
let shareUrl = "https://www.pgyer.com/mtrelease?inviterId="
#else
let shareUrl = "https://itunes.apple.com/cn/app/觅颜me/id1501489904?inviterId="
#endif

let RechargeH5BaseUrl = "http://mygs-api.bantiaoyu.cn/pay-h5.html"

/// 服务器基地址
public var AuthServerBaseUrl : String {
    get {
        switch targetConfig {
        case .debug :
            return AuthDevServer
        case .test :
            return AuthTestServer
        case .staging :
            return AuthStagingServer
        case .release :
            return AuthReleaseServer
        }
    }
}

/// 当前服务器APP版本号
public let CurrentServerVersion = "0.0.1"

/// 服务器签名串
public let ServerSignKey: String = "c2ZBcGlpT1MyMDE3MDIyOA=="


let BundleId : String = {
    return Bundle.main.infoDictionary!["CFBundleIdentifier"]  as! String
}()

let DevBundleId = "com.oldchen.mt"
let ProBundleId = "com.mt.app.pro"

let TargetDevJPushAppSecretKey = "466c5ba2586a56ecac57db53"
let TargetProJPushAppSecretKey = "463f250c0a19798f5a9cf985"

/// 极光账号appkey
public let JPushAppSecretKey : String = {
//    return "463f250c0a19798f5a9cf985"
    return BundleId == DevBundleId ? TargetDevJPushAppSecretKey : TargetProJPushAppSecretKey
}()


/// 全局释放rx 对象
public let globalDisposedBag: DisposeBag = {
    return DisposeBag()
}()

// MARK: - 群组信息区域分隔符
public let groupInfoSeprate = "$$"


// MARK: - form 表单的常量定义

// MARK: - 俱乐部相关
/// 俱乐部ID
public let clubIdKey = "clubIdKey"
/// 俱乐部 / 俱乐部活动 名称
public let clubNameKey = "caName"
/// 俱乐部 / 活动 人数
public let clubPeopleKey = "caPeople"
/// 俱乐部活动开始时间
public let clubDateKey = "caDate"
/// 俱乐部活动地址
public let clubAddrKey = "caAddr"
/// 俱乐部自动发礼物
public let clubGiftKey = "caGift"
/// 俱乐部详细地址
public let clubAddrDetailKey = "caAddrDetail"
/// 俱乐部 / 俱乐部活动简介
public let clubDescriptionKey = "caDescription"
/// 俱乐部成员
public let clubMemberKey = "caMember"
/// 俱乐部头像
public let clubAvatorKey = "clubAvatorKey"
/// 红包金额
public let clubRAmountKey = "clubRAmountKey"
/// 红包数量
public let clubRCountKey = "clubRCountKey"
/// 红包发放时间
public let clubRDateKey = "clubRDateKey"


public let defaultPlaceholderIcon60x60 = "Icon-60"
public let defaultPlaceholderIcon1024 = "app-icon-1024"

// MARK: - 创建聚会任务相关
/// 聚会任务类型
public let partyType = "partyType"
/// 聚会任务主题
public let partyTheme = "partyTheme"
/// 聚会任务标题
public let partyTitle = "partyTitle"
/// 聚会时间
public let partyTime = "partyTime"
/// 聚会地点
public let partyAddress = "partyAddress"
/// 聚会详细地点
public let partyDetailAddress = "partyDetailAddress"
/// 聚会任务金
public let partyMoney = "partyMoney"
/// 聚会邀请人数
public let partyJoinAmount = "partyJoinAmount"
/// 异地酒店机票
public let partyPlan = "partyPlan"
/// 匿名发布
public let partyHidden = "partyHidden"
/// 聚会详细说明
public let partyDescription = "partyDescription"



// MARK: - 创建聚会任务详情相关
public let partyDetailHeader = "partyDetailHeader"

public let partyDetailType = "partyDetailType"

public let partyDetailRemark = "partyDetailRemark"

public let partyDetailTimeAddress = "partyDetailTimeAddress"
